// Package routers is good
// @APIVersion 1.0.0
// @Title mobile API
// @Description mobile has every tool to get any job done, so codename for the new mobile APIs.
// @Contact astaxie@gmail.com
package routers

import (
	"rbapi/api"
	"rbapi/controllers"
	"rbapi/socket"

	"github.com/labstack/echo"
)

// InitRouter 加载路由配置
func InitRouter(e *echo.Echo) {
	// ns := beego.NewNamespace("/v1",
	// 	beego.NSNamespace("/user",
	// 		beego.NSInclude(&controllers.UserController{})))
	// beego.AddNamespace(ns)

	// e.GET("/", &controllers.MainController{})
	e.GET("/login", api.Login)
	e.GET("/captcha/*", api.GetCaptcha)
	// beego.Router("/captcha/", &controllers.UserController{}, "get:GetCaptcha")
	e.POST("/logon", api.Logon)
	e.GET("/logout", api.Logout)
	e.GET("/admin", api.Index)

	// user控制器
	e.GET("/user/get_all_user", api.GetAllUser)

	// socket test
	e.GET("/socket", controllers.SocketTest)

	// ws
	e.GET("/ws", socket.Hello)

}
